package com.cgs.query.connection

import com.cgs.query.domain.QuerySource
import com.codahale.metrics.MetricRegistry
import java.sql.Connection
import javax.sql.DataSource

/**连接工厂*/
interface ConnectionFactory {

    fun getConnection(projectName: String): Connection

    fun getConnection(querySource: QuerySource): Connection

    fun returnConnection(conn: Connection)

    fun removeConnectionBySourceId(sourceId: String) {}

    fun removeConnection(projectName: String) {}

    fun getDataSource(sourceId: String): DataSource {
        TODO()
    }

    fun setMetricRegistry(MetricRegistry: MetricRegistry) {
        TODO()
    }
}